﻿using System;
using System.Collections.Generic;
using System.Linq;
using CTMOES;
using CTMOES.Models;

namespace CTMOES.DAL
{
    /// <summary>
    /// 得分的数据访问器
    /// </summary>
    public class ScoreProvider
    {
        /// <summary>
        /// 数据库上下文
        /// </summary>
        private static readonly CTMDBEntities _db = new CTMDBEntities();

        /// <summary>
        /// 添加分数
        /// </summary>
        /// <param name="score">分数模型</param>
        /// <returns>成功标志</returns>
        public static bool AddScore(ScoreModel score)
        {
            return true;
        }

        /// <summary>
        /// 更新分数
        /// </summary>
        /// <param name="score">分数模型</param>
        /// <returns>成功标志</returns>
        public static bool UpdateScore(ScoreModel score)
        {
            return true;
        }

        /// <summary>
        /// 删除得分
        /// </summary>
        /// <param name="paperID">试卷ID</param>
        /// <param name="studentID">学生ID</param>
        /// <returns>成功标志</returns>
        public static bool DeleteScore(Guid paperID, Guid studentID)
        {
            return true;
        }

        /// <summary>
        /// 获取某学生的所有成绩
        /// </summary>
        /// <param name="studentID">学生ID</param>
        /// <returns>某学生的所有成绩</returns>
        public static List<ScoreModel> GetScoreByStudentID(Guid studentID)
        {
            List<ScoreModel> list = new List<ScoreModel>();

            return list;
        }

        /// <summary>
        /// 获取某次考试的所有学生的成绩
        /// </summary>
        /// <param name="paperID">试卷ID</param>
        /// <returns>某次考试的所有学生的成绩</returns>
        public static List<ScoreModel> GetScoreByPaperID(Guid paperID)
        {
            List<ScoreModel> list = new List<ScoreModel>();

            return list;
        }

        /// <summary>
        /// 获取某此考试某学生的成绩
        /// </summary>
        /// <param name="paperID">试卷ID</param>
        /// <param name="studentID">学生ID</param>
        /// <returns>分数模型</returns>
        public static ScoreModel GetScore(Guid paperID, Guid studentID)
        {
            ScoreModel model = new ScoreModel();

            return model;
        }

        /// <summary>
        /// 获取所有分数
        /// </summary>
        /// <returns>所有分数集合</returns>
        public static List<ScoreModel> GetAllScore()
        {
            List<ScoreModel> list = new List<ScoreModel>();
            return list;
        }
    }
}